using System;
using System.Xml;
using System.Xml.Xsl;

using umbSearch.businessLogic.defaultFilters.helpers;

namespace umbSearch.businessLogic.defaultFilters
{
	/// <summary>
	/// Summary description for IndexOpenOffice.
	/// </summary>
    public class IndexOpenOffice : interfaces.IUmbracoSearchFileFilter
	{
		public IndexOpenOffice()
		{
			//
			// TODO: Add constructor logic here
			//
		}
		#region IUmbracoSearchFileFilter Members

		public string[] extensions
		{
			get
			{
				string[] _extensions = {"odt"};
				return _extensions;
			}
		}

		public string returnText(string FullPathToFile)
		{
			try 
			{
				return OpenOfficeIndexer.Parse(FullPathToFile);
			} 
			catch (Exception ee)
			{
				throw new Exception("Error indexing file '" + FullPathToFile + "'",ee);
			}
		}

		#endregion
	}
}
